import Vue from 'vue'
import App from './App.vue'
import router from './router/index.js'
import store from './store'
import 'animate.css'
import AddressPop from './components/AddressPop'
Vue.component('address-pop',AddressPop) //全局挂载

// 集成ElementUI组件库
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

Vue.config.productionTip = false

// 尝试提取本地存储的用户信息
let info = localStorage.getItem('userInfo')
if(info){
  store.commit('user/initUserInfo',{
    'info':JSON.parse(info)
  })
}

new Vue({
  render: h => h(App),
  router,  //注入路由
  store,  //注入状态机
}).$mount('#app')
